package w83b.w83bOperacionesPaso.w83bBandejaEntrada;

import java.util.HashMap;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import w83b.w83bBeans.W83bPreavisosBean;

import es.ejie.frmk.presentacion.operacion.paso.Q70ActionPasoOP;
import es.ejie.frmk.presentacion.sesiondatos.Q70ContextoEJIE;

public class w83bBuscarDetPreavOutOPAction extends Q70ActionPasoOP{

	
	protected void processOP(Q70ContextoEJIE contexto, ActionErrors errores, ActionMapping mapping,
			ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
		//Guardamos la accion en el contexto
	}

	protected ActionForward processForward(Q70ContextoEJIE contexto, ActionErrors errors, ActionMapping mapping, 
			ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

		HashMap mapa=(HashMap)contexto.get("w83bMapaPreavisos");
		W83bPreavisosBean preaviso=(W83bPreavisosBean)contexto.get("w83bPreavisosNuevoBean");
		contexto.set("w83bPreavisosAntiguoBean",contexto.get("w83bPreavisosNuevoBean"));
		preaviso.setIdioma((String)mapa.get("idioma"));
		//preaviso.setUsuarioBean((W83bUsuarioXLNetsBean)mapa.get("user"));
		if (preaviso.getProvincia()!=null){
			contexto.set("w83bprovincia", preaviso.getProvincia());
		}
		else{
			contexto.set("w83bprovincia", "");
		}
		if (preaviso.getCodMunicipio()!=null){
			contexto.set("w83bmunicipio", preaviso.getCodMunicipio());
		}
		else{
			contexto.set("w83bmunicipio", "");
		}
		return mapping.findForward("ok");
	}
	


}
